#ifndef IMAGEWIDGET_H
#define IMAGEWIDGET_H
#include <widget.h>
#include "glslprogram.h"

class ImageWidget : public Widget
{
public:
     ImageWidget(const std::string& title);
     ~ImageWidget();
     void drawImage(unsigned char *srcbuf, int width, int height,
                  int channels,bool fullwindow = false);
protected:
     void initializeGL() override;
     void paintGL() override ;
     void resizeGL(int w, int h) override;
private:
     void initImage(unsigned int w,unsigned int h);
private:
      GLSLProgram program;
      unsigned int texture1;
      unsigned int VBO, VAO, EBO;
};

#endif
